#ifndef WORKPROCES_H
#define WORKPROCES_H

#include <QByteArray>
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QObject>
#include <QProcess>
#include <QRunnable>
#include <QThread>

class workProces : public QObject {
  Q_OBJECT
public:
  explicit workProces(QObject *parent = nullptr);
  ~workProces();
public slots:
  void setRunInfo(const QString &, const QString &, const QString &,
                  const QStringList &);
  void doMyWork();
private slots:
  void onReadData();
  void onReadError();

signals:
  void ReadData(const QByteArray &);
  void ReadError(const QByteArray &);
  void finished();

private:
  QThread *currentThread;
  QProcess runProc;
  QString javaEnv;
  QString exeCmd;
  QStringList argList;
  bool bStart;
};

#endif // WORKPROCES_H
